package org.adorsys.aderp.orga.domain;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.entity.RooJpaEntity;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaEntity
public class OrgaRelation {

    @NotNull
    @ManyToOne
    private OrgaRelationRole relationRole;

    @NotNull
    @ManyToOne
    private OrgaPerson targetPerson;

    @NotNull
    @ManyToOne
    private OrgaPerson person;

    @NotNull
    @Column(name = "relationKeyBk", unique = true)
    private String relationKey;

    private String description;

    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern = "dd-MM-yyyy hh:mm:ss")
    private Date fromDate;

    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern = "dd-MM-yyyy hh:mm:ss")
    private Date toDate;

    private String recordOwner;
}
